LogLogisticDistribution (generic function with 1 method)
Code
@modelfunctionloglogistic_survival( obs_time::Vector{Float64}, # time of observation fail_lb::Vector{Float64}, # lower bound of failure time fail_ub::Vector{Float64}, # upper bound of failure time fail_status::Vector{Int} # 0 if right-censored, 1 if interval-censored)# Priors scale ~Normal(8, 3) |> d ->truncated(d, lower =0) shape ~Normal(6, 3) |> d ->truncated(d, lower =0)# Create distribution with current parameters d =LogLogisticDistribution(scale, shape)# Likelihoodfor i ineachindex(obs_time)if fail_status[i] ==0# Right censored: P(T > obs_time) Turing.@addlogprob! log(survival(d, obs_time[i]))else# Interval censored: P(lb < T < ub) Turing.@addlogprob! log(cdf(d, fail_ub[i]) -cdf(d, fail_lb[i]) )endendend
loglogistic_survival (generic function with 2 methods)